#!/bin/sh

revision="read out GEM Version v0.1.3 (2023-06-10 by MIB-Wiki)"
# use --help for more info

export PATH=:/proc/boot:/sbin:/bin:/usr/bin:/usr/sbin:/net/mmx/bin:/net/mmx/usr/bin:/net/mmx/usr/sbin:/net/mmx/sbin:/net/mmx/mnt/app/armle/bin:/net/mmx/mnt/app/armle/sbin:/net/mmx/mnt/app/armle/usr/bin:/net/mmx/mnt/app/armle/usr/sbin
export LD_LIBRARY_PATH=/net/mmx/mnt/app/root/lib-target:/net/mmx/mnt/eso/lib:/net/mmx/eso/lib:/net/mmx/mnt/app/usr/lib:/net/mmx/mnt/app/armle/lib:/net/mmx/mnt/app/armle/lib/dll:/net/mmx/mnt/app/armle/usr/lib
export IPL_CONFIG_DIR=/etc/eso/production

thisname="$(basename $0)"
thisdir="$(dirname $0)"

if [ -z $LOG ]; then
	. $thisdir/../config/GLOBALS > /dev/null
	echo -ne "\n$ME-$thisname---->\n" >> $LOG
fi

if [ -f $TMP/reboot.mib ]; then
	echo -ne "Aborted because the reboot is running...\n" | $TEE -a $LOG
	return 2> /dev/null
fi

if [ -z $MODELID ]; then
	. $thisdir/../config/LOCALS > /dev/null
fi

case $1 in
	-p) {
		trap '' 2

		cat $thisdir/../config/LOGO
		echo $VERSION
		echo -ne "______________________________________________________________________\n"
		echo -ne "Train = "$TRAINVERSION" "$MUVERSION"\n"
		echo -ne "Part number (SW) = "$PARTNO" Hardware version = "$HWNO"\n"
		echo -ne "EEPROM Variant (Variant1) = "$COMPONENT"\n"
		echo -ne "Metainfo2 Variant (Variant2) = "$VARIANT"\n"
		echo -ne "Fazit = "$FAZIT"\n"
		echo -ne "Long coding = "$CODING"\n"
		echo -ne "Car model = "$MODEL"\n"
		echo -ne "VIN MIB = "$VINMIB"\n"
		echo -ne "VIN car = "$VINCAR"\n"
		echo -ne "______________________________________________________________________\n\n"

		#get Gracenote database
		if [[ -e /net/mmx/mnt/gracenotedb/database.fileinfo ]]; then
			echo -n 'GracenoteDB ='
			cat /net/mmx/mnt/gracenotedb/database.fileinfo  | grep "Version" | cut -d '=' -f 2
		fi
		#get Navigation database
		#Common Harman
		if [[ -e /net/mmx/mnt/navdb/database/DBInfo.txt ]]; then
			echo -n 'NavDB = '
			cat /net/mmx/mnt/navdb/database/DBInfo.txt | grep DevVersion | cut -d= -f 2 | sed "s/\"//g"
		elif [[ -e /net/mmx/fs/sda0/DBInfo.txt ]]; then
			echo -n 'NavDB = '
			cat /net/mmx/fs/sda0/DBInfo.txt | grep DevVersion | cut -d= -f 2 | sed "s/\"//g"
		elif [[ -e /net/mmx/fs/sdb0/DBInfo.txt ]]; then
			echo -n 'NavDB = '
			cat /net/mmx/fs/sdb0/DBInfo.txt | grep DevVersion | cut -d= -f 2 | sed "s/\"//g"
		fi
		#get Asia Navigation database
		if [[ -e /net/mmx/mnt/navdb/db/DBInfo.txt ]]; then
			echo -n 'NavDB = '
			cat /net/mmx/mnt/navdb/db/DBInfo.txt | grep DBName | cut -d= -f 2 | sed "s/\"//g"
		elif [[ -e /net/mmx/fs/sda0/db/DBInfo.txt  ]]; then
			echo -n 'NavDB =: '
			cat /net/mmx/fs/sda0/db/DBInfo.txt | grep DBName | cut -d= -f 2 | sed "s/\"//g"
		elif [[ -e /net/mmx/fs/sdb0/db/DBInfo.txt  ]]; then
			echo -n 'NavDB = '
			cat /net/mmx/fs/sdb0/db/DBInfo.txt | grep DBName | cut -d= -f 2 | sed "s/\"//g"
		fi
		#get RSDB version
		if [[ -e /net/mmx/mnt/app/eso/bin/apps/radiodata ]]; then
			echo -n 'Radiodata = '
			use /net/mmx/mnt/app/eso/bin/apps/radiodata | grep VERSION |cut -d '=' -f2
		fi

		if [[ -e /net/mmx/mnt/boardbook/RSDB/Update.txt ]]; then
			RSDB_NAME=$(basename /net/mmx/mnt/boardbook/RSDB/*.sqlite | sed 's/.sqlite//')
			RSDB_VERSION=$(cat /net/mmx/mnt/boardbook/RSDB/Update.txt | grep "version.default" | sed 's/version.default=//')
			echo "Radiodata DB: $RSDB_NAME $RSDB_VERSION"
		fi
		echo -n "Languages supported = "
		cat /net/mmx/mnt/app/eso/hmi/lsd/lang_hmi_builtin.config
		echo
		echo '-----------'
		echo -n "Exceptionlist: "
		cat /net/mmx/net/rcc/dev/shmem/version.txt | grep "ExceptionList|data|0|App|" | cut -d '|' -f 5

		projectstring=`cat /net/mmx/mnt/system/etc/project.txt`

		#get APP version
		echo -n '\nAPP: '
		head -1 /net/mmx/mnt/app/img_ver.txt | sed "s/^#//"
		#get Branch
		echo -n 'Branch:'
		cat /net/mmx/mnt/app/version_info.txt | grep Branch | cut -d '=' -f 2
		#get Changelist or Label
		CHANGELIST=`cat /net/mmx/mnt/app/version_info.txt | grep "Up to CL" | cut -d '=' -f 2`
		if [ ! -z $CHANGELIST ]; then
				echo -n 'Changelist:'
				cat /net/mmx/mnt/app/version_info.txt | grep "Up to CL" | cut -d '=' -f 2
		else
				echo -n 'Label:'
				cat /net/mmx/mnt/app/version_info.txt | grep "Label" | cut -d '=' -f 2
		fi
		#get Framework
		echo -n 'Framework (MMX):'
		cat /net/mmx/mnt/app/version_info.txt | grep Framework | cut -d '=' -f 2
		if [[ -e /net/rcc/dev/shmem/esoRCCVersion ]]; then
			echo -n 'Framework (RCC): '
			cat /net/rcc/dev/shmem/esoRCCVersion | head -1 | cut -d '=' -f 2
		fi
		echo -n 'GraphicsServices:'
		cat /net/mmx/mnt/app/version_info.txt | grep GraphicsServices | cut -d '=' -f 2
		#get J9 version
		echo -n 'J9:'
		cat /net/mmx/mnt/app/version_info.txt | grep J9 | cut -d '=' -f 2
		#get DSI
		echo -n 'DSI:'
		cat /net/mmx/mnt/app/version_info.txt | grep "DSI =" | cut -d '=' -f 2
		#get Navigation
		echo -n 'Navigation:'
		if [[ $FIRST_TIER_SUPPLIER == "AISIN" ]]; then
			cat /net/mmx/mnt/app/navigation/Navigation_version.txt | grep -i 'name =' | cut -d '=' -f 2
		elif [[ $FIRST_TIER_SUPPLIER == "DELPHI" ]] && [ $REGION = "CN" -o $REGION = "JP" -o $REGION = "TW" -o $REGION = "KR" ]; then
			cat /net/mmx/mnt/app/navigation/Navigation_version.txt | grep -i 'name =' | cut -d '=' -f 2
		else
			if [[ -e /net/mmx/mnt/app/navigation/navStartup ]]; then
				use -i /net/mmx/mnt/app/navigation/navStartup | grep VERSION | cut -d= -f 2
			fi
		fi

		#get Navigation database
		#Common Harman
		if [[ -e /net/mmx/mnt/navdb/database/DBInfo.txt ]]; then
			echo -n 'NavDB: '
			cat /net/mmx/mnt/navdb/database/DBInfo.txt | grep DevVersion | cut -d= -f 2 | sed "s/\"//g"
		elif [[ -e /net/mmx/fs/sda0/DBInfo.txt ]]; then
			echo -n 'NavDB: '
			cat /net/mmx/fs/sda0/DBInfo.txt | grep DevVersion | cut -d= -f 2 | sed "s/\"//g"
		elif [[ -e /net/mmx/fs/sdb0/DBInfo.txt ]]; then
			echo -n 'NavDB: '
			cat /net/mmx/fs/sdb0/DBInfo.txt | grep DevVersion | cut -d= -f 2 | sed "s/\"//g"
		fi

		#get Asia Navigation database
		if [[ -e /net/mmx/mnt/navdb/db/DBInfo.txt ]]; then
			echo -n 'NavDB: '
			cat /net/mmx/mnt/navdb/db/DBInfo.txt | grep DBName | cut -d= -f 2 | sed "s/\"//g"
		elif [[ -e /net/mmx/fs/sda0/db/DBInfo.txt  ]]; then
			echo -n 'NavDB: '
			cat /net/mmx/fs/sda0/db/DBInfo.txt | grep DBName | cut -d= -f 2 | sed "s/\"//g"
		elif [[ -e /net/mmx/fs/sdb0/db/DBInfo.txt  ]]; then
			echo -n 'NavDB: '
			cat /net/mmx/fs/sdb0/db/DBInfo.txt | grep DBName | cut -d= -f 2 | sed "s/\"//g"
		fi

		#get Navigation styles
		if [[ -d /net/mmx/mnt/app/navigation/resources/app ]]; then
			echo '-----------'
			echo 'Navigation styles:'
			NAV_OEM=$(cd /net/mmx/mnt/app/navigation/resources/app; ls -d * | head -1)
			MAPSTYLES_LIST=$(cd /net/mmx/mnt/app/navigation/resources/app/${NAV_OEM}; ls -d *)
			for reg in ${MAPSTYLES_LIST}
			do
				if [[ -e /net/mmx/mnt/app/navigation/resources/app/${NAV_OEM}/${reg}/version.txt ]]; then
					vers=$(head -1 /net/mmx/mnt/app/navigation/resources/app/${NAV_OEM}/${reg}/version.txt)
				else
					vers=$(head -1 /net/mmx/mnt/app/navigation/resources/app/${NAV_OEM}/${reg}/version-cfg.txt)
				fi
				echo $reg = $vers
			done
			echo '-----------'
		fi

		if [[ -e /net/mmx/scripts/getEggnogDBVersionInfo.sh ]]; then
			/net/mmx/scripts/getEggnogDBVersionInfo.sh
		fi

		#get Truffles database information
		if [[ -e /net/mmx/mnt/navdb/truffles/db/common/version.txt ]]; then
			echo '-----------'
			echo 'Truffles: '
				TRUFFLES_FILE_CONTENT=$(cat /net/mmx/mnt/navdb/truffles/db/common/version.txt | cut -d '=' -f 1 -f 2 | sed "s/\"//g" |  sed "s/ //g" )
				for line in $TRUFFLES_FILE_CONTENT
				do
				echo "Truffles.$line"
				done
			echo '-----------'
		#for Scale - checking /net/mmx/fs/sda0 or /net/mmx/fs/sdb0
		elif [[ -e /net/mmx/fs/sdb0/truffles/db/common/version.txt ]];then
			echo '-----------'
			echo 'Truffles: '
				TRUFFLES_FILE_CONTENT=$(cat /net/mmx/fs/sdb0/truffles/db/common/version.txt | cut -d '=' -f 1 -f 2 | sed "s/\"//g" |  sed "s/ //g" )
				for line in $TRUFFLES_FILE_CONTENT
				do
				echo "Truffles.$line"
				done
			echo '-----------'
		elif [[ -e /net/mmx/fs/sda0/truffles/db/common/version.txt ]];then
			echo '-----------'
			echo 'Truffles: '
				TRUFFLES_FILE_CONTENT=$(cat /net/mmx/fs/sda0/truffles/db/common/version.txt | cut -d '=' -f 1 -f 2 | sed "s/\"//g" |  sed "s/ //g" )
				for line in $TRUFFLES_FILE_CONTENT
				do
				echo "Truffles.$line"
				done
			echo '-----------'
		elif [[ -e /net/mmx/mnt/navdb/truffles/db/version.txt ]]; then
			echo '-----------'
			echo 'Truffles: '
			echo 'Attention! You seem to have an out-dated truffles DB (plain structure). '
			echo 'Consider following these steps:'
			echo '1) Update to the latest truffles DB.'
			echo '2) Delete old database structure (plain structure) in GEM/mmx/truffles.'
			cat /net/mmx/mnt/navdb/truffles/db/version.txt
			echo '-----------'
		else
			echo 'Truffles: No version information available.'
		fi

		#get Speech
		echo -n 'Speech: '
		use -i /net/mmx/mnt/app/speech/SpeechLauncher | grep VERSION | cut -d= -f 2

		#get Speech Resources
		if [[ -e /net/mmx/mnt/speech/tts/data_EU/version.info ]]; then
			echo -n 'Speech resources: '
			cat /net/mmx/mnt/speech/tts/data_EU/version.info | grep svn_tag | cut -d '=' -f 2 | sed "s/\"//g"
		elif [[ -e /net/mmx/mnt/speech/tts/data_ROW/version.info ]]; then
			echo -n 'Speech resources: '
			cat /net/mmx/mnt/speech/tts/data_ROW/version.info | grep svn_tag | cut -d '=' -f 2 | sed "s/\"//g"
		elif [[ -e /net/mmx/mnt/speech/tts/data/version.info ]]; then
			echo -n 'Speech resources: '
			cat /net/mmx/mnt/speech/tts/data/version.info | grep svn_tag | cut -d '=' -f 2 | sed "s/\"//g"
		fi
		# get Speech VDE Resources
		if [[ -e /net/mmx/mnt/navdb/speech/sr/vde/EU/common.fileinfo ]]; then
			if grep -qi version /net/mmx/mnt/navdb/speech/sr/vde/EU/common.fileinfo; then
				echo -n 'Speech VDE resources (EU common):'
				grep -i version /net/mmx/mnt/navdb/speech/sr/vde/EU/common.fileinfo | cut -d '=' -f 2
			fi
		fi
		#get SpeechNLU
		if [[ -e /net/mmx/eso/lib/libesoSem.so ]]; then
			echo -n 'SpeechNLU: '
			use -i /net/mmx/eso/lib/libesoSem.so | grep ^VERSION | cut -d= -f 2
		fi

		#get SSE
		if [[ -e /net/mmx/mnt/app/eso/bin/apps/sseProc ]]; then
			echo -n 'sseProc: '
			use -i /net/mmx/mnt/app/eso/bin/apps/sseProc | grep ^VERSION | cut -d= -f 2
		fi

		#get HMI
		echo -n 'HMI: '
		if [[ -e /net/mmx/mnt/app/eso/hmi/version.properties ]]; then # this is true for PAG, AU and BY
		   cat /net/mmx/mnt/app/eso/hmi/version.properties | grep HMI_Version | cut -d ':' -f 2
		   echo -n 'HUDSON_BUILD_TAG: '
		   #echo -n "    "
		   cat /net/mmx/mnt/app/eso/hmi/version.properties | grep jenkins | cut -d ':' -f 2
		   # Get TextTool
		   if [ -f /net/mmx/eso/hmi/TTVersion.properties ]; then
			grep "TextTool" /net/mmx/eso/hmi//TTVersion.properties
			if grep -q OptionDrawerVersion /net/mmx/eso/hmi//TTVersion.properties; then
				echo "OptionDrawerVersion: `grep OptionDrawerVersion /eso/hmi//TTVersion.properties | cut -d ' ' -f2`"
			fi
		   fi
		else # this is true for VW, SE and SK
		   cat /net/mmx/mnt/app/version_info.txt | grep HMI | cut -d '=' -f 2
		   
		fi

		#get GCT version
		GCT_VERSION_PATH=`ls -d /net/mmx/mnt/app/speech/hmi/??_?? | head -1`
		if [[ ! -z ${GCT_VERSION_PATH} ]] && [[ -e ${GCT_VERSION_PATH}/version.txt ]]; then
			if grep -q ^GCT= ${GCT_VERSION_PATH}/version.txt; then
				echo -n 'GCT version: '
				grep ^GCT= ${GCT_VERSION_PATH}/version.txt | cut -d '=' -f 2
			fi
		fi
		#get voice_encoder_app
		echo -n 'VoiceEncoderApp: '
		if [[ -e /net/mmx/mnt/app/eso/bin/apps/voice_encoder_app ]]; then
			use -i /net/mmx/mnt/app/eso/bin/apps/voice_encoder_app | grep VERSION | cut -d= -f 2
		fi
		#get Gracenote database
		if [[ -e /net/mmx/mnt/gracenotedb/database.fileinfo ]]; then
			echo -n 'GracenoteDB:'
			cat /net/mmx/mnt/gracenotedb/database.fileinfo  | grep "Version" | cut -d '=' -f 2
		fi
		#get Gracenote Revision
		if [[ -e /net/mmx/mnt/gracenotedb/database/rev.txt ]]; then
			echo -n 'Gracenote: '
			cat /net/mmx/mnt/gracenotedb/database/rev.txt | head -1
		fi
		if [[ $CHIP_VENDOR == "NVIDIA" ]]; then
			#get Nvidia drop
			echo -n 'Nvidia:'
			cat /net/mmx/mnt/app/version_info.txt | grep Nvidia | cut -d '=' -f 2
			if grep -q MM2 /net/mmx/mnt/app/version_info.txt; then
				#get MME2 version
				echo -n 'MME2 version:'
				cat /net/mmx/mnt/app/version_info.txt | grep "MM2 Version" | cut -d '=' -f 2
			else
				#get MME build date
				echo -n 'MME build date:'
				cat /net/mmx/mnt/app/version_info.txt | grep "MME Build" | cut -d '=' -f 2
				#get MME version
				echo -n 'MME version:'
				cat /net/mmx/mnt/app/version_info.txt | grep "MME Version" | cut -d '=' -f 2
			fi
			#get NMSDK version
			if [[ -e /net/mmx/mnt/app/armle/usr/sbin/io-media-nvidia-dynamic ]]; then
				echo -n 'NMSDK: '
				use -i /net/mmx/mnt/app/armle/usr/sbin/io-media-nvidia-dynamic | grep "NMSDK" | cut -d '=' -f 2
			fi
		else
			echo -n 'Cinemo: '
			if grep -q "Cinemo Version" /net/mmx/mnt/app/version_info.txt; then
				cat /net/mmx/mnt/app/version_info.txt | grep "Cinemo Version" | cut -d '=' -f 2
			else
				echo "No information available"
			fi
			echo -n 'Toolchain: '
			if grep -q "Toolchain" /net/mmx/mnt/app/version_info.txt; then
				cat /net/mmx/mnt/app/version_info.txt | grep "Toolchain" | cut -d '=' -f 2
			else
				echo "No information available"
			fi
			echo -n 'PDK: '
			if grep -q "PDK" /net/mmx/mnt/app/version_info.txt; then
				cat /net/mmx/mnt/app/version_info.txt | grep "PDK" | cut -d '=' -f 2
			else
				echo "No information available"
			fi
		fi
		#get exFAT-Library
		if [[ -e /net/mmx/lib/dll/fs-exfat.so ]]; then
				echo -n 'exFAT-Library: '
				use -i /net/mmx/lib/dll/fs-exfat.so | grep ^DATE | cut -d= -f 2
		fi
		#get Google Earth version
		if [[ -e /net/mmx/mnt/app/gemib/gemib ]]; then
			echo -n 'Google Earth: '
			if [ `use -i /net/mmx/mnt/app/gemib/gemib | grep VERSION | grep '"'` ]; then
				use -i /net/mmx/mnt/app/gemib/gemib | grep VERSION | cut -d '"' -f2
			else
				use -i /net/mmx/mnt/app/gemib/gemib | grep VERSION | cut -d '=' -f2
			fi
		fi
		#get Streetview version
		if [[ -e /net/mmx/mnt/app/streetview/streetview ]]; then
			echo -n 'Streetview: '
			use -i /net/mmx/mnt/app/streetview/streetview | grep VERSION |cut -d '=' -f2
		fi

		#get RSDB version
		if [[ -e /net/mmx/mnt/app/eso/bin/apps/radiodata ]]; then
			echo -n 'Radiodata: '
			use /net/mmx/mnt/app/eso/bin/apps/radiodata | grep VERSION |cut -d '=' -f2
		fi

		if [[ -e /net/mmx/mnt/boardbook/RSDB/Update.txt ]]; then
			RSDB_NAME=$(basename /net/mmx/mnt/boardbook/RSDB/*.sqlite | sed 's/.sqlite//')
			RSDB_VERSION=$(cat /net/mmx/mnt/boardbook/RSDB/Update.txt | grep "version.default" | sed 's/version.default=//')
			echo "Radiodata DB: $RSDB_NAME $RSDB_VERSION"
		fi

		if [[ -e /net/mmx/sbin/devp-iso-mmx ]]; then
			echo -n 'devp-iso-mmx: '
			use -i /net/mmx/sbin/devp-iso-mmx | grep DATE | cut -d '=' -f 2
		fi
		#get SDIS version

		if [[ -e /net/mmx/mnt/ota/tmp/sdis/sdis.img.fileinfo ]]; then
			echo -n 'SDIS: '
			cat /net/mmx/mnt/ota/tmp/sdis/sdis.img.fileinfo | grep "Version" | cut -d '=' -f 2
		fi

		#get wordprediction version
		if [[ -e /net/mmx/mnt/app/wordprediction/awp ]]; then
			echo -n 'AWP: '
			echo -n "`use /mnt/app/wordprediction/awp |grep "Awp"|cut -d ':' -f 2`"
		fi

		#get Carlife version
		if [[ -e /net/mmx/mnt/app/carlife/carlife ]]; then
			echo -n '\nCarlife: '
			use -i /net/mmx/mnt/app/carlife/carlife | grep VERSION |cut -d '=' -f2
		fi

		#get IOC version
		if [[ -e /net/rcc/dev/shmem/version.txt ]]; then
			echo -n '\nIOC: '
			cat /net/rcc/dev/shmem/version.txt | grep 'IOC|Main|' | grep 'App' | cut -d '|' -f 5
		fi
		#get RCC version info
		if [[ -e /net/rcc/etc/version/RCC-version.txt ]]; then
			echo '\nRCC version info:'
			cat /net/rcc/etc/version/RCC-version.txt | grep "version "
		fi

		#get RCC label info
		if [[ -e /net/rcc/etc/version/RCC-version.txt ]]; then
			echo '\nRCC label info:'
			cat /net/rcc/etc/version/RCC-version.txt | grep "label "
		fi

		# If one or more files like /tmp/Version_Info_*.txt exist then print all
		# of them (file name is used as title line with _ replaced by space and
		# .txt at the end removed):

		cd /net/mmx/tmp
		LIST=$( eval echo Version_Info_*.txt )
		if [ "$LIST" != 'Version_Info_*.txt' ]
		then
			for file in Version_Info_*.txt
			do
				echo "\n"$( echo $file | sed -e s'/_/ /'g | sed -r -e s'/(.*)\.txt/\1/' )":"
				cat "$file"
			done
		fi

		echo "\n" 

		#get BOM
		echo '\nMMX Board information:'
		echo -n 'BOM: '
		cat /net/mmx/dev/nvsku/bom

		#get project
		echo -n '\nProject: '
		cat /net/mmx/dev/nvsku/project

		#get sku
		echo -n '\nSKU: '
		cat /net/mmx/dev/nvsku/sku

		#get board revision
		echo -n '\nVersion: '
		cat /net/mmx/dev/nvsku/rev

		#get serial number
		echo -n '\nserial number: '
		cat /net/mmx/dev/nvsku/serial_num
		echo "\n"

		if [[ -e /net/mmx/mnt/app/detailed_changelists_info.txt ]]; then
			cat /net/mmx/mnt/app/detailed_changelists_info.txt
		fi
	};;

	# help or unknown parameter ------------------------------
	*) {
		echo ""
		echo $revision
		echo ""
		echo "Usage: "$thisname" [OPTION]"
		echo ""
		echo "Options:"
		echo "        -p            print all GEM Version"
		echo "        --help        show this help"
		echo ""
		echo "Note: Backup will only work in RCC bash!"
		echo ""
		echo "This program is free software; you can redistribute it and/or"
		echo "modify it under the terms of the GNU General Public License"
		echo "as published by the Free Software Foundation; either version 2"
		echo "of the License, or (at your option) any later version."
		echo ""
		echo "This program is distributed in the hope that it will be useful,"
		echo "but WITHOUT ANY WARRANTY; without even the implied warranty of"
		echo "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
		echo "See the GNU General Public License for more details."
		echo ""
		echo "You should have received a copy of the GNU General Public License"
		echo "along with this program; if not, write to the Free Software Foundation,"
		echo "Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA."
		echo ""
	};;
esac

trap 2
exit 0